import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      component: HomeView,
      children: [
        {
          path: "food-add",
          name: "foodAdd",
          component: import("@/views/food/FoodAdd.vue"),
        },
        {
          path: "food-index",
          name: "foodIndex",
          component: import("@/views/food/FootIndex.vue"),
        },
        {
          path: "food-detail",
          name: "foodDetail",
          component: import("@/views/food/FootDetail.vue"),
        },
        {
          path: "food-list",
          name: "foodList",
          component: import("@/views/food/FootList.vue"),
        },
        {
          path: "food-edit",
          name: "foodEdit",
          component: import("@/views/food/FootEdit.vue"),
        },
        {
          path: "health",
          name: "Health",
          component: import("@/views/health/Health.vue"),
        },
        {
          path: "about",
          name: "About",
          component: import("@/views/about/About.vue"),
        },
      ],
    },
  ],
});

export default router;
